PyIgnition

https://github.com/animatinator/PyIgnition update for Python 3
Clone: git clone https://git.frombelow.net/PyIgnition.git
Log | Files | Refs | README

Test load.py (784B)


      1 import pygame, PyIgnition, sys
      2 
      3 INFILE = "Water.ppe"
      4 BGCOL = (255, 255, 255)
      5 
      6 
      7 screen = pygame.display.set_mode((800, 600))
      8 pygame.display.set_caption("PyIgnition demo: file I/O :: loading from output of \'PyIgnition demo: collisions\' (Water.py)")
      9 clock = pygame.time.Clock()
     10 
     11 
     12 effect = PyIgnition.ParticleEffect(screen, (0, 0), (800, 600))
     13 effect.LoadFromFile(INFILE)
     14 effect.sources[0].SetPos(pygame.mouse.get_pos())
     15 
     16 
     17 while True:
     18     for event in pygame.event.get():
     19         if event.type == pygame.QUIT:
     20             sys.exit()
     21         elif event.type == pygame.MOUSEMOTION:
     22             effect.sources[0].SetPos(pygame.mouse.get_pos())
     23 
     24     screen.fill(BGCOL)
     25     effect.Update()
     26     effect.Redraw()
     27     
     28     pygame.display.update()
     29     clock.tick(30)